{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c51eb318",
   "metadata": {},
   "outputs": [],
   "source": [
    "#!/usr/bin/python3\n",
    "# -*- coding: utf-8 -*-\n",
    "\n",
    "import os\n",
    "import sys\n",
    "import time\n",
    "import math\n",
    "import pandas as pd\n",
    "import numpy  as np\n",
    "from datetime import datetime, timedelta\n",
    "import traceback\n",
    "from utils.timecheck import ntp_client\n",
    "\n",
    "from api.asset     import cal_strategy_trade_usdt\n",
    "from api.position  import update_symbol_info, reset_leverage\n",
    "from api.market    import fetch_all_binance_swap_candle_data, fetch_binance_ticker_data\n",
    "from api.trade     import cal_order_amount, place_order, get_twap_symbol_info_list\n",
    "from utils.notification import send_msg_for_position, send_wechat_work_msg,send_dataframe\n",
    "\n",
    "from functions     import cal_factor, set_fundingrate,Select_coin\n",
    "from utils.commons import robust, sleep_until_run_time\n",
    "from rebalance.fee import replenish_bnb\n",
    "from config        import *\n",
    "\n",
    "#sys.stdout.reconfigure(encoding='utf-8')\n",
    "\n",
    "\n",
    "\n",
    "# ntp_client()\n",
    "# ====初始化\n",
    "quant.initialize()\n",
    "debug = True\n",
    "# ===设置默认最大杠杆数，变相增加资金容量\n",
    "\n",
    "\n",
    "#获取全策略的列表\n",
    "all_strategy_list = []\n",
    "for strategy_ in strategy_dic:\n",
    "    all_strategy_list += strategy_dic[strategy_]['strategy_list']\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "25d1e6bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "if not debug:\n",
    "# ===设置默认最大杠杆数，变相增加资金容量\n",
    "    reset_leverage(quant.exchange, max_leverage=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7530209f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'c_factor': '将军_20w',\n",
       "  'hold_period': '1H',\n",
       "  'type': '横截面',\n",
       "  'factors': [('纯手捏Mtm51', True, 36, 0, 1)],\n",
       "  'filters': [('斐波那契过滤', 12), ('涨跌幅max', 24)],\n",
       "  'filters_handle': {'before': 'f1_before_filter_fia9',\n",
       "   'after': 'default_handler'},\n",
       "  'long_weight': 2,\n",
       "  'short_weight': 0,\n",
       "  'select_coin_num': 1},\n",
       " {'c_factor': '将军_20w',\n",
       "  'hold_period': '1H',\n",
       "  'type': '横截面',\n",
       "  'factors': [('纯手捏Mtm51', True, 18, 0, 1)],\n",
       "  'filters': [('斐波那契过滤', 12), ('涨跌幅max', 24)],\n",
       "  'filters_handle': {'before': 'f1_before_filter_fia9',\n",
       "   'after': 'default_handler'},\n",
       "  'long_weight': 0,\n",
       "  'short_weight': 2,\n",
       "  'select_coin_num': 1},\n",
       " {'c_factor': '赛博狗2',\n",
       "  'hold_period': '24H',\n",
       "  'type': '横截面',\n",
       "  'factors': [('赛博狗2', True, 2160, 0, 1)],\n",
       "  'filters': [],\n",
       "  'filters_handle': {'before': 'default_handler', 'after': 'default_handler'},\n",
       "  'long_weight': 1,\n",
       "  'short_weight': 1,\n",
       "  'select_coin_num': 10}]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_strategy_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "32a197be",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# ===加载市场信息\n",
    "quant.load_market()\n",
    "# =====设置参数\n",
    "exchange        \t = quant.exchange\n",
    "symbol_list     \t = quant.symbol_list\n",
    "min_qty         \t = quant.min_qty\n",
    "price_precision \t = quant.price_precision\n",
    "min_notional  \t\t = quant.min_notional\n",
    "njob1           \t = quant.njob1\n",
    "njob2           \t = quant.njob2\n",
    "trade_ratio     \t = quant.trade_ratio\n",
    "strategy_list   \t = all_strategy_list\n",
    "min_kline_size  \t = quant.min_kline_size\n",
    "max_one_order_amount = quant.max_one_order_amount\n",
    "twap_interval        = quant.twap_interval\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "be8446b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<config.QuantConfig at 0x7f25500fe700>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "quant"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "1ce120d1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2024-03-02 01:20:00\n",
      "2\n",
      "获取所有币种K线数据完成，花费时间： 127.07898759841919\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# =====sleep直到下一个整点小时\n",
    "if debug:\n",
    "    print(1)\n",
    "    run_time = datetime.strptime('2024-03-02 01:20:00', \"%Y-%m-%d %H:%M:%S\")\n",
    "    print(run_time)\n",
    "    #run_time = sleep_until_run_time('1h', if_sleep=False, cheat_seconds=0)\n",
    "else:\n",
    "    run_time = sleep_until_run_time('1h', if_sleep=True,  cheat_seconds=0)\n",
    "\n",
    "now = datetime.now()\n",
    "# =====合约每日结算时api暂停1分钟\n",
    "if (now.hour % 8 == 0 and now.minute == 0):\n",
    "    print('每日结算时间')\n",
    "    time.sleep(60 - now.second)\n",
    "\n",
    "print(2)\n",
    "# =====并行获取所有币种的1小时K线\n",
    "s_time = time.time()\n",
    "symbol_candle_data = fetch_all_binance_swap_candle_data(exchange, symbol_list, run_time, njob1)\n",
    "print('获取所有币种K线数据完成，花费时间：', time.time() - s_time)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e832ddc4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "保存资金数据完成，花费时间： 0.29640769958496094\n",
      "no enough data PORTALUSDT\n",
      "no enough data TONUSDT\n",
      "no enough data AXLUSDT\n",
      "========================实例化计算因子中========================\n",
      "back_hour_list: [24, 48, 72, 96, 120, 144, 168, 336, 504, 720, 1440, 2160]\n",
      "dataset_dates: ['2021-01-01', '2023-09-30', '2023-10-01', '2023-11-01']\n",
      "model_path: /home/admin/多策略多账户/src_product_多/factors/赛博狗2.py.pkl\n",
      "hyper_paras: {'learning_rate': 0.01, 'max_depth': 15, 'num_leaves': 661, 'min_data_in_leaf': 22}\n",
      "filter_list: []\n",
      "suggest_hold_hour: 24\n",
      "================================================================\n",
      "完成选币数据整理，花费时间： 240.0861735343933\n"
     ]
    }
   ],
   "source": [
    "# =====获取当前资金费率\n",
    "s_time = time.time()\n",
    "set_fundingrate(exchange)\n",
    "print('保存资金数据完成，花费时间：', time.time() - s_time)\n",
    "\n",
    "# =====选币数据整理 & 选币\n",
    "#计算因子\n",
    "s_time = time.time()\n",
    "alldata = cal_factor(\n",
    "    symbol_candle_data, strategy_list, run_time, njob2, min_kline_size=min_kline_size\n",
    ")\n",
    "print('完成选币数据整理，花费时间：', time.time() - s_time)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22226548",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1472d0a9",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "策略1\n",
      "账户净值: 3999.8208003600002 杠杆: 1.5 实际净值: 5999.73120054\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "策略2\n",
      "账户净值: 491.22532489 杠杆: 2 实际净值: 982.45064978\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n"
     ]
    }
   ],
   "source": [
    "\n",
    "### 遍历账号，下单\n",
    "for strategy_ in strategy_dic:\n",
    "    print(strategy_)\n",
    "    #初始化quant\n",
    "    apiKey = strategy_dic[strategy_]['apiKey']\n",
    "    secret = strategy_dic[strategy_]['secret']\n",
    "    strategy_list = strategy_dic[strategy_]['strategy_list']\n",
    "    trade_ratio = strategy_dic[strategy_]['trade_ratio']\n",
    "    quant_ = QuantConfig(apiKey, secret, proxy, njob1, njob2, trade_ratio, min_kline_size, black_list,\n",
    "                        max_one_order_amount, twap_interval, strategy_list, debug=Debug)\n",
    "    quant_.initialize()\n",
    "    exchange = quant_.exchange\n",
    "    strategy_list = quant_.strategy_list\n",
    "\n",
    "    #####################\n",
    "    # 获取U本位合约账户净值(不包含未实现盈亏)\n",
    "    if debug:\n",
    "        # 测试计算\n",
    "        # equity = 1000\n",
    "        # 真实账户\n",
    "        balance    = robust(exchange.fapiPrivateV2_get_balance, func_name='fapiPrivateV2_get_balance')  # 获取账户净值\n",
    "        balance    = pd.DataFrame(balance)\n",
    "        equity     = float(balance[balance['asset'] == 'USDT']['balance'])\n",
    "        equity_unrealized = float(balance[balance['asset'] == 'USDT']['crossUnPnl'])\n",
    "\n",
    "    else:\n",
    "        balance    = robust(exchange.fapiPrivateV2_get_balance, func_name='fapiPrivateV2_get_balance')  # 获取账户净值\n",
    "        balance    = pd.DataFrame(balance)\n",
    "        equity     = float(balance[balance['asset'] == 'USDT']['balance'])\n",
    "        equity_unrealized = float(balance[balance['asset'] == 'USDT']['crossUnPnl'])\n",
    "\n",
    "    trade_usdt = (equity+equity_unrealized)*trade_ratio\n",
    "    print('账户净值:', (equity+equity_unrealized), '杠杆:', trade_ratio, '实际净值:', trade_usdt)\n",
    "    send_wechat_work_msg(f\"账户净值: {equity+equity_unrealized}美元,加完杠杆后的资金量 {trade_usdt}美元!\")\n",
    "    #trade_usdt = equity*trade_ratio\n",
    "    #print('账户净值:', equity, '杠杆:', trade_ratio, '实际净值:', trade_usdt)\n",
    "    # =====获取每个策略分配的资金：固定资金，之后的版本会改成浮动\n",
    "    strategy_trade_usdt = cal_strategy_trade_usdt(strategy_list, trade_usdt)\n",
    "    # =====获取账户的实际持仓\n",
    "    if debug:\n",
    "        # symbol_info = pd.DataFrame(index=symbol_list, columns=['当前持仓量'])\n",
    "        # symbol_info['当前持仓量'] = 0\n",
    "         symbol_info = update_symbol_info(exchange, symbol_list)\n",
    "    else:\n",
    "        symbol_info = update_symbol_info(exchange, symbol_list)\n",
    "    #\n",
    "    dfsendtowechat=symbol_info[symbol_info[\"当前持仓量\"]!=0] #正负持仓\n",
    "    send_dataframe(dfsendtowechat)\n",
    "    # =====开始计算&下单\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "cc0e8e74",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "策略1\n",
      "账户净值: 4001.3808264500003 杠杆: 1.5 实际净值: 6002.0712396750005\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "    candle_begin_time     symbol    close  方向  offset           key\n",
      "0 2024-03-02 01:00:00  SPELLUSDT  0.00162   2       0  将军_20w_1H_0H\n",
      "1 2024-03-02 01:00:00  MAVIAUSDT  5.55090   0       0  将军_20w_1H_0H\n",
      "0 2024-03-02 01:00:00  SPELLUSDT  0.00162   0       0  将军_20w_1H_0H\n",
      "1 2024-03-02 01:00:00   NTRNUSDT  1.48740  -2       0  将军_20w_1H_0H\n",
      "               当前持仓量         目标下单量  目标下单份数        实际下单量    实际下单资金\n",
      "SPELLUSDT  1848181.0  1.853063e+06     2.0  4882.056399   7.90649\n",
      "NTRNUSDT     -2054.0 -2.017639e+03    -2.0    36.361423  54.08398\n",
      "MAVIAUSDT        0.1  0.000000e+00     0.0    -0.100000  -0.55509\n",
      "策略2\n",
      "账户净值: 491.18966235 杠杆: 2 实际净值: 982.3793247\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "调用企业微信接口返回： {\"errcode\":0,\"errmsg\":\"ok\"}\n",
      "成功发送企业微信\n",
      "      candle_begin_time        symbol      close  方向  offset          key\n",
      "0   2024-03-01 02:00:00  1000PEPEUSDT   0.002900   1       2  赛博狗2_24H_2H\n",
      "1   2024-03-01 02:00:00     ALICEUSDT   1.859000   1       2  赛博狗2_24H_2H\n",
      "2   2024-03-01 02:00:00     AUDIOUSDT   0.289000   1       2  赛博狗2_24H_2H\n",
      "3   2024-03-01 02:00:00      COMPUSDT  92.780000   1       2  赛博狗2_24H_2H\n",
      "4   2024-03-01 02:00:00      COTIUSDT   0.215600   1       2  赛博狗2_24H_2H\n",
      "..                  ...           ...        ...  ..     ...          ...\n",
      "475 2024-03-02 01:00:00       GRTUSDT   0.312830  -1       1  赛博狗2_24H_1H\n",
      "476 2024-03-02 01:00:00     OCEANUSDT   0.957700  -1       1  赛博狗2_24H_1H\n",
      "477 2024-03-02 01:00:00       UNIUSDT  11.766000  -1       1  赛博狗2_24H_1H\n",
      "478 2024-03-02 01:00:00       XVGUSDT   0.006175  -1       1  赛博狗2_24H_1H\n",
      "479 2024-03-02 01:00:00       YGGUSDT   0.697400  -1       1  赛博狗2_24H_1H\n",
      "\n",
      "[480 rows x 6 columns]\n",
      "           当前持仓量      目标下单量  目标下单份数      实际下单量     实际下单资金\n",
      "LTCUSDT      0.0  -0.049414    -2.0  -0.049414  -4.096462\n",
      "BATUSDT      0.0  71.331515    10.0  71.331515  20.736072\n",
      "QTUMUSDT     3.9   0.000000     NaN  -3.900000        NaN\n",
      "THETAUSDT  -21.5  25.877670    24.0  47.377670  90.704549\n",
      "COMPUSDT     0.0   0.534082    24.0   0.534082  48.863149\n",
      "...          ...        ...     ...        ...        ...\n",
      "ONDOUSDT   -51.5   8.683437     2.0  60.183437  28.502876\n",
      "ALTUSDT     -4.0   0.000000     NaN   4.000000        NaN\n",
      "ZETAUSDT     0.0 -15.243351   -17.0 -15.243351 -34.594786\n",
      "OMUSDT     -31.6 -69.888654    -9.0 -38.288654 -10.438253\n",
      "PIXELUSDT    0.0  28.999657     7.0  28.999657  14.583928\n",
      "\n",
      "[69 rows x 5 columns]\n"
     ]
    }
   ],
   "source": [
    "for strategy_ in strategy_dic:\n",
    "    print(strategy_)\n",
    "    #初始化quant\n",
    "    apiKey = strategy_dic[strategy_]['apiKey']\n",
    "    secret = strategy_dic[strategy_]['secret']\n",
    "    strategy_list = strategy_dic[strategy_]['strategy_list']\n",
    "    trade_ratio = strategy_dic[strategy_]['trade_ratio']\n",
    "    quant_ = QuantConfig(apiKey, secret, proxy, njob1, njob2, trade_ratio, min_kline_size, black_list,\n",
    "                        max_one_order_amount, twap_interval, strategy_list, debug=Debug)\n",
    "    quant_.initialize()\n",
    "    exchange = quant_.exchange\n",
    "    strategy_list = quant_.strategy_list\n",
    "\n",
    "    #####################\n",
    "    # 获取U本位合约账户净值(不包含未实现盈亏)\n",
    "    if debug:\n",
    "        # 测试计算\n",
    "        # equity = 1000\n",
    "        # 真实账户\n",
    "        balance    = robust(exchange.fapiPrivateV2_get_balance, func_name='fapiPrivateV2_get_balance')  # 获取账户净值\n",
    "        balance    = pd.DataFrame(balance)\n",
    "        equity     = float(balance[balance['asset'] == 'USDT']['balance'])\n",
    "        equity_unrealized = float(balance[balance['asset'] == 'USDT']['crossUnPnl'])\n",
    "\n",
    "    else:\n",
    "        balance    = robust(exchange.fapiPrivateV2_get_balance, func_name='fapiPrivateV2_get_balance')  # 获取账户净值\n",
    "        balance    = pd.DataFrame(balance)\n",
    "        equity     = float(balance[balance['asset'] == 'USDT']['balance'])\n",
    "        equity_unrealized = float(balance[balance['asset'] == 'USDT']['crossUnPnl'])\n",
    "\n",
    "    trade_usdt = (equity+equity_unrealized)*trade_ratio\n",
    "    print('账户净值:', (equity+equity_unrealized), '杠杆:', trade_ratio, '实际净值:', trade_usdt)\n",
    "    send_wechat_work_msg(f\"账户净值: {equity+equity_unrealized}美元,加完杠杆后的资金量 {trade_usdt}美元!\")\n",
    "    #trade_usdt = equity*trade_ratio\n",
    "    #print('账户净值:', equity, '杠杆:', trade_ratio, '实际净值:', trade_usdt)\n",
    "    # =====获取每个策略分配的资金：固定资金，之后的版本会改成浮动\n",
    "    strategy_trade_usdt = cal_strategy_trade_usdt(strategy_list, trade_usdt)\n",
    "    # =====获取账户的实际持仓\n",
    "    if debug:\n",
    "        # symbol_info = pd.DataFrame(index=symbol_list, columns=['当前持仓量'])\n",
    "        # symbol_info['当前持仓量'] = 0\n",
    "         symbol_info = update_symbol_info(exchange, symbol_list)\n",
    "    else:\n",
    "        symbol_info = update_symbol_info(exchange, symbol_list)\n",
    "    #\n",
    "    dfsendtowechat=symbol_info[symbol_info[\"当前持仓量\"]!=0] #正负持仓\n",
    "    send_dataframe(dfsendtowechat)\n",
    "    # =====开始计算&下单\n",
    "    select_coin = Select_coin(alldata, strategy_list, run_time)\n",
    "    symbol_info = cal_order_amount(symbol_info, select_coin, strategy_trade_usdt)\n",
    "    print(select_coin)\n",
    "    print(symbol_info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6b94cc13",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "策略2 选币成功\n"
     ]
    }
   ],
   "source": [
    "print(strategy_,'选币成功')\n",
    "if symbol_info['实际下单资金'].isnull().any():\n",
    "    symbol_last_price = fetch_binance_ticker_data(exchange)\n",
    "    nan_symbol = symbol_info.loc[symbol_info['实际下单资金'].isnull(), '实际下单资金'].index\n",
    "    symbol_info.loc[nan_symbol, '实际下单资金'] = symbol_info.loc[nan_symbol, '实际下单量'] * symbol_last_price[nan_symbol]\n",
    "\n",
    "twap_symbol_info_list = get_twap_symbol_info_list(symbol_info, max_one_order_amount)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0ee8dfe7",
   "metadata": {},
   "source": [
    "# 真实下单\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "42b6e68a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "下单参数： {'symbol': 'THETAUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 1.9597, 'quantity': 47.4, 'clientOrderId': '1709314024.3755732', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '12286903890', 'symbol': 'THETAUSDT', 'status': 'NEW', 'clientOrderId': 'RJQzwJUCsljoRU7NGWRcuR', 'price': '1.9597', 'avgPrice': '0.00', 'origQty': '47.4', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024418'} \n",
      "\n",
      "下单参数： {'symbol': 'TUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.03296, 'quantity': 1515.0, 'clientOrderId': '1709314024.4565837', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '837309950', 'symbol': 'TUSDT', 'status': 'NEW', 'clientOrderId': 'GEIOyznncbdxWKYG50ojhh', 'price': '0.0329600', 'avgPrice': '0.00', 'origQty': '1515', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024519'} \n",
      "\n",
      "下单参数： {'symbol': 'ENSUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 21.628, 'quantity': 2.3, 'clientOrderId': '1709314024.5592778', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '4592741447', 'symbol': 'ENSUSDT', 'status': 'NEW', 'clientOrderId': 'cpLWpTL38jv2Gu8sdqXCdl', 'price': '21.628', 'avgPrice': '0.00', 'origQty': '2.3', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024610'} \n",
      "\n",
      "下单参数： {'symbol': 'AGIXUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.8708, 'quantity': 53.0, 'clientOrderId': '1709314024.6502528', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '2066439494', 'symbol': 'AGIXUSDT', 'status': 'NEW', 'clientOrderId': '0oFSyFtOVnCEuB1Ufu71NA', 'price': '0.8708000', 'avgPrice': '0.00', 'origQty': '53', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024692'} \n",
      "\n",
      "下单参数： {'symbol': 'COMPUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 93.37, 'quantity': 0.534, 'clientOrderId': '1709314024.7316744', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '9416445491', 'symbol': 'COMPUSDT', 'status': 'NEW', 'clientOrderId': 'w3g6Qc9B7lgXUVUHUfCMde', 'price': '93.37', 'avgPrice': '0.00', 'origQty': '0.534', 'executedQty': '0.000', 'cumQty': '0.000', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.00', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024776'} \n",
      "\n",
      "下单参数： {'symbol': 'ZETAUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 2.2906, 'quantity': 15.0, 'clientOrderId': '1709314024.816084', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '329096971', 'symbol': 'ZETAUSDT', 'status': 'NEW', 'clientOrderId': 'WNalAQBLcHDMBIsDAGi8BA', 'price': '2.290600', 'avgPrice': '0.00', 'origQty': '15', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024856'} \n",
      "\n",
      "下单参数： {'symbol': 'DOGEUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.13372, 'quantity': 349.0, 'clientOrderId': '1709314024.896427', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '38762243027', 'symbol': 'DOGEUSDT', 'status': 'NEW', 'clientOrderId': '3WHPoXyWV9SvDI6rYkYuxx', 'price': '0.133720', 'avgPrice': '0.00', 'origQty': '349', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314024935'} \n",
      "\n",
      "下单参数： {'symbol': 'OCEANUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.9438, 'quantity': 34.0, 'clientOrderId': '1709314024.9743075', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '6167105319', 'symbol': 'OCEANUSDT', 'status': 'NEW', 'clientOrderId': 'lKeyqO3yuzcxGWR9CVnGDc', 'price': '0.94380', 'avgPrice': '0.00', 'origQty': '34', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025012'} \n",
      "\n",
      "下单参数： {'symbol': 'SPELLUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.0016239, 'quantity': 28390.0, 'clientOrderId': '1709314025.0518265', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '1345290791', 'symbol': 'SPELLUSDT', 'status': 'NEW', 'clientOrderId': 'v5fYRo5XKA7vhFx9VD7LJO', 'price': '0.0016239', 'avgPrice': '0.00', 'origQty': '28390', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025090'} \n",
      "\n",
      "下单参数： {'symbol': 'SUIUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 1.6857, 'quantity': 18.3, 'clientOrderId': '1709314025.1296012', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '5002566985', 'symbol': 'SUIUSDT', 'status': 'NEW', 'clientOrderId': 'eykCOWKTIK6Rtw2CwoGs3c', 'price': '1.685700', 'avgPrice': '0.00', 'origQty': '18.3', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025168'} \n",
      "\n",
      "下单参数： {'symbol': 'WAXPUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.08707, 'quantity': 457.0, 'clientOrderId': '1709314025.2079353', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '401271920', 'symbol': 'WAXPUSDT', 'status': 'NEW', 'clientOrderId': 'WH5qlYX3WYJFtgOpLVO7TO', 'price': '0.0870700', 'avgPrice': '0.00', 'origQty': '457', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025247'} \n",
      "\n",
      "下单参数： {'symbol': 'ONEUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.02468, 'quantity': 1176.0, 'clientOrderId': '1709314025.2865283', 'timeInForce': 'GTC', 'reduceOnly': True}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "下单完成，下单信息： {'orderId': '5787552253', 'symbol': 'ONEUSDT', 'status': 'NEW', 'clientOrderId': 'VIvSUjileRHIeH4kDJ5FdP', 'price': '0.02468', 'avgPrice': '0.00', 'origQty': '1176', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025325'} \n",
      "\n",
      "下单参数： {'symbol': 'COTIUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.21847, 'quantity': 171.0, 'clientOrderId': '1709314025.364879', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '4913186805', 'symbol': 'COTIUSDT', 'status': 'NEW', 'clientOrderId': 'YWN9RQzWr0v3O0tI09qKMT', 'price': '0.21847', 'avgPrice': '0.00', 'origQty': '171', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025404'} \n",
      "\n",
      "下单参数： {'symbol': 'ARUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 26.792, 'quantity': 1.1, 'clientOrderId': '1709314025.4441335', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '3480187242', 'symbol': 'ARUSDT', 'status': 'NEW', 'clientOrderId': '9nko0wGIw3I3VQKJVgG5GD', 'price': '26.792', 'avgPrice': '0.00', 'origQty': '1.1', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025481'} \n",
      "\n",
      "下单参数： {'symbol': 'ONDOUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.5181, 'quantity': 60.2, 'clientOrderId': '1709314025.5207274', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '345315028', 'symbol': 'ONDOUSDT', 'status': 'NEW', 'clientOrderId': 'dnBH0ydSmKBb4OyhjVHJvh', 'price': '0.5181000', 'avgPrice': '0.00', 'origQty': '60.2', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025563'} \n",
      "\n",
      "下单参数： {'symbol': 'GRTUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.30906, 'quantity': 88.0, 'clientOrderId': '1709314025.6035283', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '9397233576', 'symbol': 'GRTUSDT', 'status': 'NEW', 'clientOrderId': 'VbSrtCpOeWSHxC4pDUGOfk', 'price': '0.30906', 'avgPrice': '0.00', 'origQty': '88', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025642'} \n",
      "\n",
      "下单参数： {'symbol': '1INCHUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.5508, 'quantity': 50.0, 'clientOrderId': '1709314025.6824107', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '7503986743', 'symbol': '1INCHUSDT', 'status': 'NEW', 'clientOrderId': 'H86u1noIuY9yOU3DtGemDg', 'price': '0.5508', 'avgPrice': '0.00', 'origQty': '50', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025721'} \n",
      "\n",
      "下单参数： {'symbol': 'FILUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 8.007, 'quantity': 3.2, 'clientOrderId': '1709314025.7601345', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '26320584276', 'symbol': 'FILUSDT', 'status': 'NEW', 'clientOrderId': 'rtlK2qZSrb6ZXg3RcKePL5', 'price': '8.007', 'avgPrice': '0.00', 'origQty': '3.2', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025797'} \n",
      "\n",
      "下单参数： {'symbol': 'MAVUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.6809, 'quantity': 40.0, 'clientOrderId': '1709314025.8368614', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '889732937', 'symbol': 'MAVUSDT', 'status': 'NEW', 'clientOrderId': '18VSxnK8RStwxjlG1DjX4r', 'price': '0.6809000', 'avgPrice': '0.00', 'origQty': '40', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025875'} \n",
      "\n",
      "下单参数： {'symbol': 'POLYXUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.20508, 'quantity': 120.0, 'clientOrderId': '1709314025.915309', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '539349066', 'symbol': 'POLYXUSDT', 'status': 'NEW', 'clientOrderId': 'He7n5kg1OBpkl64R7cedyR', 'price': '0.2050800', 'avgPrice': '0.00', 'origQty': '120', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314025954'} \n",
      "\n",
      "下单参数： {'symbol': '1000BONKUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.025939, 'quantity': 976.0, 'clientOrderId': '1709314025.9931345', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '1811658519', 'symbol': '1000BONKUSDT', 'status': 'NEW', 'clientOrderId': '1RUDNqQhx1tXseLWzOtJdT', 'price': '0.0259390', 'avgPrice': '0.00', 'origQty': '976', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026060'} \n",
      "\n",
      "下单参数： {'symbol': 'DARUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.1996, 'quantity': 120.1, 'clientOrderId': '1709314026.1001215', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '1587995601', 'symbol': 'DARUSDT', 'status': 'NEW', 'clientOrderId': '3kZ82CIeSEYsye5SLo8nFr', 'price': '0.1996', 'avgPrice': '0.00', 'origQty': '120.1', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026138'} \n",
      "\n",
      "下单参数： {'symbol': 'BATUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.2974, 'quantity': 71.3, 'clientOrderId': '1709314026.1786468', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '4805509975', 'symbol': 'BATUSDT', 'status': 'NEW', 'clientOrderId': 'pgCcPhnuFt94t6GxJB9xEh', 'price': '0.2974', 'avgPrice': '0.00', 'origQty': '71.3', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026216'} \n",
      "\n",
      "下单参数： {'symbol': 'UNIUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 11.5, 'quantity': 2.0, 'clientOrderId': '1709314026.2565129', 'timeInForce': 'GTC', 'reduceOnly': False}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "下单完成，下单信息： {'orderId': '20887257429', 'symbol': 'UNIUSDT', 'status': 'NEW', 'clientOrderId': 'JuXi4VYtLNzHcOGOlqrPId', 'price': '11.5000', 'avgPrice': '0.00', 'origQty': '2', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026294'} \n",
      "\n",
      "下单参数： {'symbol': 'ALICEUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 1.916, 'quantity': 10.1, 'clientOrderId': '1709314026.3336527', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '5483631687', 'symbol': 'ALICEUSDT', 'status': 'NEW', 'clientOrderId': 'ScrJcUglxv7l9LWp1jKjny', 'price': '1.916', 'avgPrice': '0.00', 'origQty': '10.1', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026372'} \n",
      "\n",
      "下单参数： {'symbol': '1000SHIBUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.014449, 'quantity': 1531.0, 'clientOrderId': '1709314026.4122539', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '15391037378', 'symbol': '1000SHIBUSDT', 'status': 'NEW', 'clientOrderId': 'geSY0XRccv4fgkoOiMsPCs', 'price': '0.014449', 'avgPrice': '0.00', 'origQty': '1531', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026451'} \n",
      "\n",
      "下单参数： {'symbol': 'LOOMUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.10953, 'quantity': 139.0, 'clientOrderId': '1709314026.4908943', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '1655558885', 'symbol': 'LOOMUSDT', 'status': 'NEW', 'clientOrderId': '4c8SVBzFeSmPrzhPBreo4v', 'price': '0.1095300', 'avgPrice': '0.00', 'origQty': '139', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026533'} \n",
      "\n",
      "下单参数： {'symbol': 'ARKMUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 2.4919, 'quantity': 8.0, 'clientOrderId': '1709314026.5719097', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '780460255', 'symbol': 'ARKMUSDT', 'status': 'NEW', 'clientOrderId': 'rbDXgkcfQe6Gz0DhNfS2T7', 'price': '2.4919000', 'avgPrice': '0.00', 'origQty': '8', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026610'} \n",
      "\n",
      "下单参数： {'symbol': 'PIXELUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.5253, 'quantity': 29.0, 'clientOrderId': '1709314026.6504767', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '131008868', 'symbol': 'PIXELUSDT', 'status': 'NEW', 'clientOrderId': 'xOsUt7qeiiIkxzgFz0iHVk', 'price': '0.5253000', 'avgPrice': '0.00', 'origQty': '29', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026688'} \n",
      "\n",
      "下单参数： {'symbol': 'LEVERUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.002218, 'quantity': 8690.0, 'clientOrderId': '1709314026.7268836', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '1962456317', 'symbol': 'LEVERUSDT', 'status': 'NEW', 'clientOrderId': 'S2mW34XPXsSNQ4gYs6wu7M', 'price': '0.0022180', 'avgPrice': '0.00', 'origQty': '8690', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026765'} \n",
      "\n",
      "下单参数： {'symbol': 'JASMYUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.021207, 'quantity': 489.0, 'clientOrderId': '1709314026.8048038', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '3036294927', 'symbol': 'JASMYUSDT', 'status': 'NEW', 'clientOrderId': 'wLsSHrPIJHZxtaJNdmLUij', 'price': '0.021207', 'avgPrice': '0.00', 'origQty': '489', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026843'} \n",
      "\n",
      "下单参数： {'symbol': 'GMTUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.3169, 'quantity': 54.0, 'clientOrderId': '1709314026.8830354', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '13880781772', 'symbol': 'GMTUSDT', 'status': 'NEW', 'clientOrderId': 'TvyE3CBAxuBxIrDNIPSOS6', 'price': '0.31690', 'avgPrice': '0.00', 'origQty': '54', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026921'} \n",
      "\n",
      "下单参数： {'symbol': 'EDUUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.9279, 'quantity': 12.0, 'clientOrderId': '1709314026.9605384', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '1546452890', 'symbol': 'EDUUSDT', 'status': 'NEW', 'clientOrderId': 'm6kM8lTJB8gFiZLid4faU3', 'price': '0.9279000', 'avgPrice': '0.00', 'origQty': '12', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314026998'} \n",
      "\n",
      "下单参数： {'symbol': 'IOTXUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.06051, 'quantity': 267.0, 'clientOrderId': '1709314027.0375862', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '2947772843', 'symbol': 'IOTXUSDT', 'status': 'NEW', 'clientOrderId': 'nYJD3YlPOG4wDoddhzUPkH', 'price': '0.06051', 'avgPrice': '0.00', 'origQty': '267', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027086'} \n",
      "\n",
      "下单参数： {'symbol': 'CFXUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.2718, 'quantity': 31.0, 'clientOrderId': '1709314027.1265728', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '7539454535', 'symbol': 'CFXUSDT', 'status': 'NEW', 'clientOrderId': 'hvsq9Lr9HopYH2GdS2a2T9', 'price': '0.2718000', 'avgPrice': '0.00', 'origQty': '31', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027164'} \n",
      "\n",
      "下单参数： {'symbol': 'WIFUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 1.0, 'quantity': 15.6, 'clientOrderId': '1709314027.2043386', 'timeInForce': 'GTC', 'reduceOnly': False}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "下单完成，下单信息： {'orderId': '452138004', 'symbol': 'WIFUSDT', 'status': 'NEW', 'clientOrderId': 'OejEi2qkHwIFkNtAPQTF9a', 'price': '1.0000000', 'avgPrice': '0.00', 'origQty': '15.6', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027242'} \n",
      "\n",
      "下单参数： {'symbol': 'XAIUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 1.4073, 'quantity': 5.0, 'clientOrderId': '1709314027.2816095', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '779589023', 'symbol': 'XAIUSDT', 'status': 'NEW', 'clientOrderId': 'OfEAw9swTsSrt1Ws9AyXqm', 'price': '1.4073000', 'avgPrice': '0.00', 'origQty': '5', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027319'} \n",
      "\n",
      "下单参数： {'symbol': 'QTUMUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 3.761, 'quantity': 3.9, 'clientOrderId': '1709314027.3579123', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '7250589542', 'symbol': 'QTUMUSDT', 'status': 'NEW', 'clientOrderId': 'CKLTSKV6GJVTPLE1MKtcAF', 'price': '3.761', 'avgPrice': '0.00', 'origQty': '3.9', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027395'} \n",
      "\n",
      "下单参数： {'symbol': 'ENJUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.4619, 'quantity': 15.0, 'clientOrderId': '1709314027.4345684', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '9469726119', 'symbol': 'ENJUSDT', 'status': 'NEW', 'clientOrderId': 's7rmjH0Ax3ZHWPsExjo8se', 'price': '0.46190', 'avgPrice': '0.00', 'origQty': '15', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027472'} \n",
      "\n",
      "下单参数： {'symbol': 'OMUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.2697, 'quantity': 38.3, 'clientOrderId': '1709314027.512597', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '54114903', 'symbol': 'OMUSDT', 'status': 'NEW', 'clientOrderId': 'GRCSHqTdmHQjyVU0jeARzm', 'price': '0.2697000', 'avgPrice': '0.00', 'origQty': '38.3', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027553'} \n",
      "\n",
      "下单参数： {'symbol': '1000PEPEUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.0040718, 'quantity': 2112.0, 'clientOrderId': '1709314027.5928328', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '5286899183', 'symbol': '1000PEPEUSDT', 'status': 'NEW', 'clientOrderId': 'QX9SmvNKkkyQRhEmGkDvbb', 'price': '0.0040718', 'avgPrice': '0.00', 'origQty': '2112', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027631'} \n",
      "\n",
      "下单参数： {'symbol': 'XVGUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.006104, 'quantity': 1667.0, 'clientOrderId': '1709314027.6701932', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '758466220', 'symbol': 'XVGUSDT', 'status': 'NEW', 'clientOrderId': '0DgEJGm32Ksr5BallxnnHi', 'price': '0.0061040', 'avgPrice': '0.00', 'origQty': '1667', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027708'} \n",
      "\n",
      "下单参数： {'symbol': '1000FLOKIUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.07439, 'quantity': 78.0, 'clientOrderId': '1709314027.7484858', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '971287729', 'symbol': '1000FLOKIUSDT', 'status': 'NEW', 'clientOrderId': 'MBQ7NxIUCLHUb5O92ESkTR', 'price': '0.0743900', 'avgPrice': '0.00', 'origQty': '78', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027787'} \n",
      "\n",
      "下单参数： {'symbol': 'HBARUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.11332, 'quantity': 89.0, 'clientOrderId': '1709314027.826441', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '4542071261', 'symbol': 'HBARUSDT', 'status': 'NEW', 'clientOrderId': 'IoZWVuthuGonD7qUI7D1yD', 'price': '0.11332', 'avgPrice': '0.00', 'origQty': '89', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027869'} \n",
      "\n",
      "quantity * price < 5\n",
      "下单参数： {'symbol': 'FETUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 1.7159, 'quantity': 6.0, 'clientOrderId': '1709314027.9089704', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '2584731497', 'symbol': 'FETUSDT', 'status': 'NEW', 'clientOrderId': 'a7IqamrNAS7lgVaQNYEjl5', 'price': '1.7159000', 'avgPrice': '0.00', 'origQty': '6', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314027946'} \n",
      "\n",
      "quantity * price < 5\n",
      "下单参数： {'symbol': 'IDUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.6066, 'quantity': 14.0, 'clientOrderId': '1709314027.9869878', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '2388101771', 'symbol': 'IDUSDT', 'status': 'NEW', 'clientOrderId': 'Tm8qTCxr89vKz2PdvlPRyA', 'price': '0.6066000', 'avgPrice': '0.00', 'origQty': '14', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028026'} \n",
      "\n",
      "下单参数： {'symbol': 'CTSIUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.4075, 'quantity': 10.0, 'clientOrderId': '1709314028.0656936', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '2631449281', 'symbol': 'CTSIUSDT', 'status': 'NEW', 'clientOrderId': 'lGfqjGMaI8ogYfFeQufXVk', 'price': '0.4075', 'avgPrice': '0.00', 'origQty': '10', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028103'} \n",
      "\n",
      "下单参数： {'symbol': 'BICOUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.4972, 'quantity': 16.0, 'clientOrderId': '1709314028.1425292', 'timeInForce': 'GTC', 'reduceOnly': False}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "下单完成，下单信息： {'orderId': '425756504', 'symbol': 'BICOUSDT', 'status': 'NEW', 'clientOrderId': 'cWSJ6RVY2xiSTuQIHgbpsf', 'price': '0.4972000', 'avgPrice': '0.00', 'origQty': '16', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028181'} \n",
      "\n",
      "下单参数： {'symbol': 'APTUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 11.843, 'quantity': 0.2, 'clientOrderId': '1709314028.2205122', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '8028086942', 'symbol': 'APTUSDT', 'status': 'NEW', 'clientOrderId': 'qZ1hOaMsNBUMC4TQRy43zm', 'price': '11.84300', 'avgPrice': '0.00', 'origQty': '0.2', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028258'} \n",
      "\n",
      "下单参数： {'symbol': 'WOOUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.52898, 'quantity': 15.0, 'clientOrderId': '1709314028.2973716', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '3288106074', 'symbol': 'WOOUSDT', 'status': 'NEW', 'clientOrderId': 'KuB2ORzjgmOW3eGWmBvPtW', 'price': '0.52898', 'avgPrice': '0.00', 'origQty': '15', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.00000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028337'} \n",
      "\n",
      "quantity * price < 5\n",
      "下单参数： {'symbol': 'STRAXUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 1.3442, 'quantity': 5.0, 'clientOrderId': '1709314028.375899', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '645963353', 'symbol': 'STRAXUSDT', 'status': 'NEW', 'clientOrderId': 'kXZwD1hiFmizDjGaRKNaEF', 'price': '1.3442000', 'avgPrice': '0.00', 'origQty': '5', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028414'} \n",
      "\n",
      "quantity * price < 5\n",
      "下单参数： {'symbol': 'CKBUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.015744, 'quantity': 405.0, 'clientOrderId': '1709314028.4534395', 'timeInForce': 'GTC', 'reduceOnly': False}\n",
      "下单完成，下单信息： {'orderId': '841077359', 'symbol': 'CKBUSDT', 'status': 'NEW', 'clientOrderId': 'KMGrDR6yufMKsAeqM1aY9z', 'price': '0.0157440', 'avgPrice': '0.00', 'origQty': '405', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028492'} \n",
      "\n",
      "UMAUSDT 0.0 实际下单量为0，不下单\n",
      "下单参数： {'symbol': 'RLCUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 4.0811, 'quantity': 1.5, 'clientOrderId': '1709314028.5306866', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '6091897363', 'symbol': 'RLCUSDT', 'status': 'NEW', 'clientOrderId': 'q1etuILVMXcenCjeBRgzVi', 'price': '4.0811', 'avgPrice': '0.00', 'origQty': '1.5', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.00000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028568'} \n",
      "\n",
      "下单参数： {'symbol': 'ALTUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 0.49063, 'quantity': 4.0, 'clientOrderId': '1709314028.6068194', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '592107613', 'symbol': 'ALTUSDT', 'status': 'NEW', 'clientOrderId': 'AHmZ8kQiZUJSlOJNRi9aFM', 'price': '0.4906300', 'avgPrice': '0.00', 'origQty': '4', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028645'} \n",
      "\n",
      "下单参数： {'symbol': 'ICXUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.2899, 'quantity': 21.0, 'clientOrderId': '1709314028.6849866', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '4070923673', 'symbol': 'ICXUSDT', 'status': 'NEW', 'clientOrderId': 'aKXlgaSJNpBo8WmfJH1xDp', 'price': '0.2899', 'avgPrice': '0.00', 'origQty': '21', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028724'} \n",
      "\n",
      "下单参数： {'symbol': 'CYBERUSDT', 'side': 'BUY', 'type': 'LIMIT', 'price': 10.238, 'quantity': 0.2, 'clientOrderId': '1709314028.763957', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '1756723974', 'symbol': 'CYBERUSDT', 'status': 'NEW', 'clientOrderId': 'B0Vngm9Na3nRgtJJ6VSfs2', 'price': '10.238000', 'avgPrice': '0.00', 'origQty': '0.2', 'executedQty': '0.0', 'cumQty': '0.0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0.000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028802'} \n",
      "\n",
      "下单参数： {'symbol': 'ORBSUSDT', 'side': 'SELL', 'type': 'LIMIT', 'price': 0.04327, 'quantity': 99.0, 'clientOrderId': '1709314028.842046', 'timeInForce': 'GTC', 'reduceOnly': True}\n",
      "下单完成，下单信息： {'orderId': '517454636', 'symbol': 'ORBSUSDT', 'status': 'NEW', 'clientOrderId': 'XaGKRd6Ssz9Fncd1p02Atp', 'price': '0.0432700', 'avgPrice': '0.00', 'origQty': '99', 'executedQty': '0', 'cumQty': '0', 'cumQuote': '0.0000000', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': True, 'closePosition': False, 'side': 'SELL', 'positionSide': 'BOTH', 'stopPrice': '0.0000000', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'priceMatch': 'NONE', 'selfTradePreventionMode': 'NONE', 'goodTillDate': '0', 'updateTime': '1709314028879'} \n",
      "\n",
      "quantity * price < 5\n",
      "quantity * price < 5\n",
      "quantity * price < 5\n",
      "quantity * price < 5\n",
      "quantity * price < 5\n",
      "quantity * price < 5\n",
      "RNDRUSDT 0.0 实际下单量为0，不下单\n",
      "当前账户剩余0.0210028 BNB\n",
      "-------------------- 本次循环结束，20.000000秒后进入下一次循环 --------------------\n",
      "\n",
      "\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[11], line 32\u001b[0m\n\u001b[1;32m     30\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m20\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m本次循环结束，\u001b[39m\u001b[38;5;132;01m%f\u001b[39;00m\u001b[38;5;124m秒后进入下一次循环\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m%\u001b[39m \u001b[38;5;241m20\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m20\u001b[39m)\n\u001b[1;32m     31\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m---> 32\u001b[0m \u001b[43mtime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m20\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "# for i in range(len(twap_symbol_info_list)):\n",
    "#     # =====获取币种的最新价格\n",
    "#     symbol_last_price = fetch_binance_ticker_data(exchange)\n",
    "#     # =====逐批下单\n",
    "#     if not debug:\n",
    "#         place_order(exchange, twap_symbol_info_list[i], symbol_last_price, min_qty, price_precision, min_notional)\n",
    "#     else:\n",
    "#         # 测试计算\n",
    "#         # print('测试拆单', twap_symbol_info_list[i])\n",
    "#         # continue\n",
    "#         # 真实账户\n",
    "#         place_order(exchange, twap_symbol_info_list[i], symbol_last_price, min_qty, price_precision, min_notional)\n",
    "#     if i < len(twap_symbol_info_list) - 1 :\n",
    "#         print(f'Twap {twap_interval} s 等待')\n",
    "#         time.sleep(twap_interval)\n",
    "#     if not debug:\n",
    "#         replenish_bnb(exchange, balance)\n",
    "#     else:\n",
    "#         # 测试计算\n",
    "#         # exit()\n",
    "#         # 真实账户\n",
    "#         replenish_bnb(exchange, balance)\n",
    "        \n",
    "#     if debug:\n",
    "#         exit()\n",
    "#     # 清理数据\n",
    "# #     del symbol_candle_data, select_coin, symbol_info\n",
    "#     # 本次循环结束\n",
    "#     # 时间补偿\n",
    "#     print('-' * 20, '本次循环结束，%f秒后进入下一次循环' % 20, '-' * 20)\n",
    "#     print('\\n')\n",
    "#     time.sleep(20)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1586c889",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:py38] *",
   "language": "python",
   "name": "conda-env-py38-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
